import {commonParams} from './config'

var baseUrl = 'https://u.y.qq.com/cgi-bin/musicu.fcg?'
export function getSinger(params, callback) {
	const r = '-=getUCGI' + (Math.random() + '').replace('0.', '')
	const data = Object.assign({}, commonParams, {
		loginUin: 0,
		hostUin: 0,
		format: 'json',
		platform: 'yqq.json',
		needNewCode: 0,
		data: {"comm":{"ct":24,"cv":0},"singerList":{"module":"Music.SingerListServer","method":"get_singer_list","param":{"area":params.area || -100,"sex":params.sex || -100,"genre":params.genre || -100,"index":params.index || -100,"sin":params.sin,"cur_page":params.cur_page || 1}}}
	})
	uni.request({
		url: baseUrl + r,
		data: data,
		method: 'GET',
		success: function(res) {
			// console.log(res)
			callback(res.data)
		}
	})
}